package com.itnoob.demo2;

/**
 * @author zhoujun
 * @date 2025/3/26 21:03
 */
public class Product {

    private double price;

    private String type;


    public Product(double price, String type) {
        this.price = price;
        this.type = type;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    /**
     * 添加一个accept方法,用于接受访问者对象,并调佣访问者的visit方法,传入自身作为参数
     * @param visitor
     */
    public void  accept(Visitor visitor){
        visitor.visit(this);
    }
}
